import request from '@/utils/request'

// 注册接口
export const userRegisterService = ({ username, password, repassword }) =>
  request.post('/api/reg', { username, password, repassword })

// 登录接口
export const userLoginService = ({ username, password }) =>
  request.post('/api/login', { username, password })
// 获取用户信息的接口
export const userGetUserInfoService = ()=>
  request.get('/my/userinfo')

//更新用户信息的接口
export const userUpdateUserInfoService = (data)=>
  request.put('/my/userinfo',data)

//更新用户头像的接口
export const userUpdateUserAvatar = (avatar)=>
  request.patch('/my/update/avatar',{avatar})

// 更新用户密码的接口
export const userUpdateUserPassword = ({old_pwd,new_pwd,re_pwd})=>
  request.patch('/my/updatepwd',{old_pwd,new_pwd,re_pwd})
